package com.cloud.auth.mapper.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
* 菜单表(Menu) 实体类
*
* @author zhangxun
* @since 2020-08-18
*/
@Data
@TableName(value = "menu")
public class Menu implements Serializable {
    private static final long serialVersionUID=1L;

    // 菜单
    public static final String TYPE_MENU = "0";
    // 按钮
    public static final String TYPE_BUTTON = "1";

    /*** 菜单/按钮ID*/
    @TableId(type = IdType.AUTO)
    private Long menuId;

    /*** 上级菜单ID*/
    @TableField("parent_id")
    private Long parentId;

    /*** 菜单/按钮名称*/
    @TableField("menu_name")
    private String menuName;

    /*** 对应路由path*/
    @TableField("path")
    private String path;

    /*** 对应路由组件component*/
    @TableField("component")
    private String component;

    /*** 权限标识*/
    @TableField("perms")
    private String perms;

    /*** 图标*/
    @TableField("icon")
    private String icon;

    /*** 类型 0菜单 1按钮*/
    @TableField("type")
    private String type;

    /*** 排序*/
    @TableField("order_num")
    private Integer orderNum;

    /*** 创建时间*/
    @TableField("create_time")
    @JsonFormat(shape= JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;

    /*** 修改时间*/
    @TableField("modify_time")
    @JsonFormat(shape= JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm:ss")
    private LocalDateTime modifyTime;

    //@TableField(exist = false)注解标注外，也可以使用transient关键字。
    private transient String createTimeFrom;
    private transient String createTimeTo;
}